local skill = fk.CreateSkill{
  name = "action__leigongzhuwo_ol_skill",
}

Fk:loadTranslationTable{
  ["action__leigongzhuwo_ol"] = "雷公助我",
  ["action__leigongzhuwo_ol_skill"] = "雷公助我",
  [":action__leigongzhuwo_ol"] = "锦囊牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：所有角色 <br /><b>效果</b>：令目标角色依次进行一次闪电判定，然后每有一名角色受到此闪电伤害，你摸一张牌。",
  ["#action__leigongzhuwo_ol_skill"] = "令所有角色依次进行一次闪电判定，然后每有一名角色受到此闪电伤害，你摸一张牌。",
}


skill:addEffect("cardskill", {
  mute = true,
  name = "action__leigongzhuwo_ol",
  prompt = "#action__leigongzhuwo_ol_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = Util.GlobalCanUse,
  on_use = function (self, room, cardUseEvent)
    return Util.AoeCardOnUse(self, cardUseEvent.from, cardUseEvent, true)
  end,
  on_effect = function(self, room, effect)
    local judge = {
      who = effect.to,
      reason = "lightning",
      pattern = ".|2~9|spade",
    }
    room:judge(judge)
    if judge.card:matchPattern(".|2~9|spade") then
      room:damage {
        to = effect.to,
        damage = 3,
        damageType = fk.ThunderDamage,
        skillName = "lightning_skill",
        card = effect.card,
      }
      if not effect.from.dead then
        effect.from:drawCards(1, skill.name)
      end
    end
  end,
})


return skill